using UnityEngine;
using System.Collections;

public class lockClass : MonoBehaviour {
	
	private globalVarsClass gv;
	private OTSprite me;
	public bool full = false;
	public string filledWith = "nothing";
	public string lockType = "gun";
	// Use this for initialization
	
	public void gemPulledOut(){
		filledWith = "nothing";
		full = false;
		gv.refreshLocks();
		if(lockType == "gun"){
			gv.refreshGunBonuses();
		}else if(lockType == "shield"){
			gv.refreshShieldBonuses();
		}else if(lockType == "global"){
			gv.setGlobalBonus("nothing");
		}
	}
	public void fillWith(string gemType){
		filledWith = gemType;
		full = true;
		gv.refreshLocks();
		if(lockType == "gun"){
			gv.refreshGunBonuses();
		}else if(lockType == "shield"){
			gv.refreshShieldBonuses();
		}else if(lockType == "global"){
			gv.setGlobalBonus(gemType);
		}
	}
	void Start () {
    	gv = GameObject.Find("GlobalVariables").GetComponent<globalVarsClass>();
		me = this.GetComponent<OTSprite>();
		gv.locksList.Add(me);
			
		gv.locksCount++;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
